<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="sj" uri="/struts-jquery-tags"%>

<script type="text/javascript">
	$(document).ready(function() {
		
	});
</script>

<s:form name="formBody" id="formBody">

<s:hidden name="start"/>
<s:hidden name="count"/>
<s:hidden name="orderBy"/>
<s:hidden name="ascDesc"/>
<s:hidden name="previousPage"/>
<s:hidden name="gotoPage"/>
<s:hidden name="id"/>
<s:hidden name="actionMethod" value="%{actionMethod}"/>
<s:token/>

<s:if test="isAdministrator == 1">
	<div class="header"><span><span class="ico gray administrator"></span>Daftar Klien Petugas Ketik / Pengecekan Hasil Ketik</span></div>
</s:if>
<s:elseif test="isDivisionHead == 1">
	<div class="header"><span><span class="ico gray administrator"></span>Pengecekan Hasil Ketik</span></div>
</s:elseif>
<s:else>
	<div class="header"><span><span class="ico gray administrator"></span>Daftar Klien Petugas Ketik</span></div>
</s:else>

<div class="content" >
	
		<!-- Third / Half column-->
		<div class="widgets">
		
			<div class="section ">
				<label>Nama Debitur</label>   
				<div> 
					<s:textfield cssClass="large" name="namaKlien" labelposition="left" maxlength="20" id="namaKlien" autocomplete="off"/>
				</div>
			</div>
			
			<div class="section last">
	            <div>
	            	<s:reset cssClass="uibutton special" value="Reset" cssStyle="width:100px"/>
	            	<s:submit action="%{actionMethod}" value="Cari" indicator="indicator" cssClass="uibutton" cssStyle="width:100px"/> 
	           	</div>
	        </div>
		
		</div><!-- End Third / Half column-->
	
   <!-- clear fix -->
<div class="clear"></div>


		<div class="tableName">
		
		<table class="display data_table1">
			<thead>
				<tr>
					<th><input type="checkbox" id="checkAll1" class="cekAll"/></th>
					<th style="text-align:center;"><div class="th_wrapp"><s:text name="label.no"/></div></th>
					<th style="text-align:left"><div class="th_wrapp">Nama Debitur</div></th>
					<!-- <th style="text-align:left"><div class="th_wrapp"><s:text name="label.noCertificate"/></div></th> -->
					<th style="text-align:left"><div class="th_wrapp"><s:text name="label.documentLocation"/></div></th>
					<th style="text-align:left"><div class="th_wrapp"><s:text name="label.tbo"/></div></th>
					<th style="text-align:left"><div class="th_wrapp"><s:text name="label.officer"/></div></th>
					<s:if test="isAdministrator == 1 || isDivisionHead == 1">
					<th style="text-align:left"><div class="th_wrapp"><s:text name="label.approved"/></div></th>
					</s:if>
					<th><div class="th_wrapp"><s:text name="label.action"/></div></th>
				</tr>
			</thead>
			<tbody>
				<s:iterator value="clients" status="sequence">
				<tr class="odd gradeX">
				    <td style="text-align:center">
				    
				    	<input type="checkbox" <s:if test="documentLocation != null && documentLocation !='' && tbo != null && tbo !='' && isApproved != null && isApproved != ''">checked = 'true'</s:if> name="clients[<s:property value="%{start+#sequence.index}"/>].id" value="<s:property value="id"/>" id="check<s:property value="%{start+#sequence.index+1}"/>"/>
				    </td>
					<td style="text-align:center"><s:property value="%{start+#sequence.index+1}"/></td>
					<td style="text-align:left"><s:property value="debitur.name"/></td>
					<!-- <td style="text-align:left"><s:property value="certificate.number"/></td> -->
					<td style="text-align:left">
					<s:if test="documentLocation != null && documentLocation !=''">
						<s:property value="documentLocation"/>
					</s:if>
					<s:else>
						<s:textfield name="clients[%{start+#sequence.index}].documentLocation" autocomplete="off"/>
					</s:else>
					</td>
					<td style="text-align:left">
					<s:if test="tbo != null && tbo !=''">
						<s:property value="tbo"/>
					</s:if>
					<s:else>
						<s:textfield name="clients[%{start+#sequence.index}].tbo" autocomplete="off"/>
					</s:else>
					</td>
					<td style="text-align:left"><s:property value="officerType.name"/></td>
					<s:if test="isAdministrator == 1 || isDivisionHead == 1">
						<td style="text-align:center">
						<s:if test="approved!= null && approved == true">
							<img src="images/icon/color_18/checkmark2.png" >
						</s:if>
						<s:else>
							<img src="images/icon/color_18/cross.png" >
						</s:else>
						</td>
					</s:if>
					<td class="center">
						<s:if test="isAdministrator == 1 || isDivisionHead == 1">
							<span class="tip" >
	                             <a href="DaftarKlienPetugasKetikAction_detail.do?id=<s:property value="%{@com.lemurian.bankdata.lite.utils.GlobalFunction@encodeParameter(id)}"/>" title="Approval" ><img src="images/icon/color_18/zoom.png" ></a>
	                        </span>&nbsp;
						</s:if>
						<s:if test="isDivisionHead != 1">
							<span class="tip" >
	                             <a href="DaftarKlienPetugasKetikAction_form.do?id=<s:property value="%{@com.lemurian.bankdata.lite.utils.GlobalFunction@encodeParameter(id)}"/>" title="Form Pengetikan" ><img src="images/icon/color_18/clipboard.png" ></a>
	                         </span>
                         </s:if>
					</td>
				</tr>
				</s:iterator>
				
			</tbody>
		</table>
		
		<div>
			<s:submit action="DaftarKlienPetugasKetikAction_save" value="SUBMIT" indicator="indicator" cssClass="uibutton confirm" cssStyle="width:100px;float: left"/>
			<s:property value="%{pagerItem}" escape="false"/>
			<div class="clear"></div>
		</div>
		
		</div>
	
   <!-- clear fix -->
<div class="clear"></div>

</div><!-- End content -->
</s:form>

<script type="text/javascript">
	$(document).ready (function() {
		$(".cekAll").click (function() {
			var checked_status = this.checked;
			$(':checkbox').each(function() {
				this.checked = checked_status;
			});
		});
	});
</script>